Computer programmers typically write in a high level programming language such as C, because it is easily read by developers and may be more easily maintained than machine code. Compilers translate this human readable program code, known as source code, into computer executable code. As well as carrying out this translation, compilers may also optimize the source code and perform other tasks, such as making architecture specific formatting. Optimization may include finding redundant code or portions of code that can never be reached, which may then be removed during the compilation process.
Further optimizations may include replacing inefficient expressions with equivalent improved efficiency expressions. However, it is often difficult for a compiler to determine whether or not complex expressions are equivalent. Rather than replacing an expression or portion of source code with one that is not equivalent the compiler may simply leave the source code unchanged to avoid any risk or unstable result. The compiler may only substitute source code when it is certain that the substitute is semantically and functionally equivalent to the original source code.
However, this can leave inefficient or redundant expressions within the source code leading to less efficient compiled executable code.